import * as React from 'react';

import { connect, history } from 'umi';
import { AdminModelState } from '@/pages/login/model';


const App: React.FunctionComponent<AdminModelState> = (props) => {

  return (<header>
    <span> 欢迎 {props.adminname}</span>
    <button onClick={()=>{
      localStorage.clear()
      history.push('/login')
    }}>退出</button>
    </header>);
};

export default connect(({admin}: {admin: AdminModelState})=>{
  return {
    adminname: admin.adminname
  }
})(App);
